home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / tpstuff1.arc / DEFDEMO.LST < prev    next >
Encoding:
File List  |  1985-08-09  |  31.3 KB  |  727 lines

  1.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 1
  2.  Line :  B    Statement
  3.  
  4.     1 : + 0   {$I Var.Inc} 
  5.     2 : + 0   CONST MaxScreens = 8;     { Number of Windows Allowed, do not Change } 
  6.     3 : + 0   Screen_seg = $B800; { Change to #B000 for MonoChrome, Change 
  7.     4 : + 0   then # sign to a Dollar sign Though. } 
  8.     5 : + 0   Data_Addr = $0000; 
  9.     6 : + 0   Fc        : ARRAY[1..4, 1..7] OF Integer 
  10.     7 : + 0   = ((218, 196, 191, 179, 192, 196, 217), 
  11.     8 : + 0   (201, 205, 187, 186, 200, 205, 188), 
  12.     9 : + 0   (213, 205, 184, 179, 212, 205, 190), 
  13.    10 : + 0   (219, 219, 219, 219, 219, 219, 219)); 
  14.    11 : + 0  
  15.    12 : + 0   TYPE maxstr     = STRING[80]; 
  16.    13 : + 0   window_rec = RECORD 
  17.    14 : + 0   x1,x2,y1,y2,c1,b1,w1,w2: Integer; 
  18.    15 : + 0   Screen: ARRAY[1..4000] OF byte; 
  19.    16 : + 0   END; 
  20.    17 : + 0  
  21.    18 : + 0   VAR  Stack_Top,Last_Window_Num, 
  22.    19 : + 0   line_pos,F1         : Integer; 
  23.    20 : + 0   screen              : ARRAY[1..4000] OF byte; 
  24.    21 : + 0   real_screen         : ARRAY[1..4000] OF byte ABSOLUTE Screen_Seg:Data_Addr; 
  25.    22 : + 0   Page_1              : ARRAY[1..4000] OF byte ABSOLUTE Screen_Seg:$1000; 
  26.    23 : + 0   Imig                : ARRAY [1..MaxScreens] OF Window_rec; 
  27.    24 : + 0   Original            : ARRAY[1..4000] OF byte; 
  28.    25 : + 0   Coords              : ARRAY[1..8,1..MaxScreens] OF Integer; 
  29.    26 : + 0   {$I Windmngr.Inc} 
  30.    27 : + 0   { Window Manager/Editor System Include file .. } 
  31.    28 : + 0  
  32.    29 : + 0   PROCEDURE set_page(page: byte); 
  33.    30 : + 0  
  34.    31 : + 0   TYPE 
  35.    32 : + 0   Result = 
  36.    33 : + 0   RECORD 
  37.    34 : + 0   AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: byte; 
  38.    35 : + 0   END; 
  39.    36 : + 0   VAR rec:result; 
  40.    37 : + 0  
  41.    38 : + 1   BEGIN 
  42.    39 : + 1    |  Rec.AX := page; 
  43.    40 : + 1    |  Rec.BX := $05; 
  44.    41 : + 1    |  Intr($10,Rec); 
  45.    42 : + 0   END; 
  46.    43 : + 0  
  47.    44 : + 0   PROCEDURE Scrn_off; 
  48.    45 : + 1   BEGIN 
  49.    46 : + 1    |  INLINE($52/$50/$ba/$d8/$03/$b0/$21/$ee/$58/$5a) 
  50.    47 : + 0   END; 
  51.    48 : + 0  
  52.    49 : + 0   PROCEDURE Scrn_on; 
  53.    50 : + 1   BEGIN 
  54.    51 : + 1    |  INLINE($52/$50/$ba/$d8/$03/$b0/$29/$ee/$58/$5a) 
  55.    52 : + 0   END; 
  56.    53 : + 0  
  57.    54 : + 0   FUNCTION active: integer; 
  58.    55 : + 1   BEGIN 
  59.    56 : + 1    |  active:=stack_top 
  60.    57 : + 0   END; 
  61.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 2
  62.  Line :  B    Statement
  63.  
  64.    58 : + 0  
  65.    59 : + 0   PROCEDURE Push(Ulx, Uly, Lrx, Lry, Foreground, Background: integer); 
  66.    60 : + 0  
  67.    61 : + 0   { This procedure Saves screens in memory. When a new window is put 
  68.    62 : + 0   on the Screen, the preceding window is stored away for later reference.} 
  69.    63 : + 0  
  70.    64 : + 1   BEGIN 
  71.    65 : + 1    |  { If last Window up, move the Original Screen into Screen Memory} 
  72.    66 : + 1    |  IF stack_top = 0 THEN 
  73.    67 : + 2    |  BEGIN 
  74.    68 : + 2    |   |  Scrn_off; 
  75.    69 : + 2    |   |  move(real_screen, Original, 4000); 
  76.    70 : + 2    |   |  Scrn_on 
  77.    71 : + 1    |  END; 
  78.    72 : + 1    |  {Save all Data concerning the windows} 
  79.    73 : + 1    |  IF (Stack_top < MaxScreens) AND (Stack_Top >= 0) THEN 
  80.    74 : + 2    |  BEGIN 
  81.    75 : + 2    |   |  Stack_top:=Stack_top+1; 
  82.    76 : + 2    |   |  Imig[Stack_top].x1:=Ulx; 
  83.    77 : + 2    |   |  Imig[Stack_top].y1:=Uly; 
  84.    78 : + 2    |   |  Imig[Stack_top].x2:=Lrx; 
  85.    79 : + 2    |   |  Imig[Stack_top].y2:=Lry; 
  86.    80 : + 2    |   |  Imig[stack_top].c1:=Foreground; 
  87.    81 : + 2    |   |  Imig[Stack_top].b1:=Background 
  88.    82 : + 1    |  END; 
  89.    83 : + 1    | 
  90.    84 : + 1    |  { Push Screen on Stack ... Sort of... } 
  91.    85 : + 1    |  Scrn_off; 
  92.    86 : + 1    |  Move(real_screen,Imig[Stack_top].Screen,4000); 
  93.    87 : + 1    |  Scrn_on 
  94.    88 : + 0   END; 
  95.    89 : + 0  
  96.    90 : + 0   PROCEDURE Pop; 
  97.    91 : + 0  
  98.    92 : + 0   { This Procedure takes the screen that procedes the current window and 
  99.    93 : + 0   Copies back to screen memory, restores all data concerning the previous 
  100.    94 : + 0   window and activates it.. Neat huh? } 
  101.    95 : + 0  
  102.    96 : + 1   BEGIN 
  103.    97 : + 1    | 
  104.    98 : + 1    |  { If no windows are active, save the current screen } 
  105.    99 : + 1    |  IF stack_top =0 THEN 
  106.   100 : + 2    |  BEGIN 
  107.   101 : + 2    |   |  normvideo; 
  108.   102 : + 2    |   |  window(1,1,80,25); 
  109.   103 : + 2    |   |  Scrn_off; 
  110.   104 : + 2    |   |  move(Original, real_screen, 4000); 
  111.   105 : + 2    |   |  Scrn_on; 
  112.   106 : + 1    |  END; 
  113.   107 : + 1    | 
  114.   108 : + 1    |  { Get Preceding screen and copy it to screen memory } 
  115.   109 : + 1    |  Scrn_off; 
  116.   110 : + 1    |  Move(Imig[Stack_top].Screen,Real_Screen,4000); 
  117.   111 : + 1    |  Scrn_on; 
  118.   112 : + 1    |  Stack_top:=Stack_top-1 
  119.   113 : + 0   END; 
  120.   114 : + 0  
  121.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 3
  122.  Line :  B    Statement
  123.  
  124.   115 : + 0   PROCEDURE Writexy(long_string:maxstr; xcoord,ycoord:integer; VAR color: inte 
  125.   115 : + 0  ger); 
  126.   116 : + 0  
  127.   117 : + 0   { This procedure Draws whatever you want, wherever you want, by changing the 
  128.   118 : + 0   value of Screen in the variable declaration, it can draw a "Picture" any- 
  129.   119 : + 0   were in memory. This allows for the Speed of the window making process..} 
  130.   120 : + 0  
  131.   121 : + 0   VAR str_len, real_pos, scr_pos: integer; 
  132.   122 : + 0  
  133.   123 : + 1   BEGIN 
  134.   124 : + 1    |  {$I-} 
  135.   125 : + 1    |  str_len:=length(long_string); { So I know how much to write } 
  136.   126 : + 1    |  Scr_pos:=0; 
  137.   127 : + 1    | 
  138.   128 : + 1    |  { The next 8 lines write the string in every "even" location in memory 
  139.   129 : + 1    |  and ever odd location gets the attribute with determines how the 
  140.   130 : + 1    |  string is displayed on the screen} 
  141.   131 : + 1    |  FOR real_pos:=1 TO str_len DO 
  142.   132 : + 1    |  IF scr_pos < 4001 THEN 
  143.   133 : + 2    |  BEGIN 
  144.   134 : + 2    |   |  scr_pos:=((xcoord*2)-1)+(ycoord*160); 
  145.   135 : + 2    |   |  screen[scr_pos]:=ord(copy(long_string,real_pos,1)); 
  146.   136 : + 2    |   |  screen[scr_pos+1]:=color; 
  147.   137 : + 2    |   |  xcoord:=xcoord+1; 
  148.   138 : + 1    |  END 
  149.   139 : + 1    |  {$I+} 
  150.   140 : + 0   END; 
  151.   141 : + 0  
  152.   142 : + 0   PROCEDURE Frame(WindowType, UpperLeftX, UpperLeftY, LowerRightX, LowerRightY 
  153.   142 : + 0  , color: Integer); 
  154.   143 : + 0  
  155.   144 : + 0   { This procedure draws the window frame in another part of memory. } 
  156.   145 : + 0   VAR i: integer; 
  157.   146 : + 1   BEGIN 
  158.   147 : + 1    |  WriteXY(chr(Fc[WindowType,1]),UpperLeftX, UpperLeftY,color); 
  159.   148 : + 1    |  FOR i:=UpperLeftX+1 TO LowerRightX-1 DO WriteXY(chr(Fc[WindowType,2]),i, 
  160.   148 : + 1    | UpperleftY,color); 
  161.   149 : + 1    |  WriteXY(chr(Fc[WindowType,3]),i+1,UpperleftY,color); 
  162.   150 : + 1    |  FOR i:=UpperLeftY+1 TO LowerRightY-1 DO 
  163.   151 : + 2    |  BEGIN 
  164.   152 : + 2    |   |  WriteXY(chr(Fc[WindowType,4]),UpperLeftX , i,color); 
  165.   153 : + 2    |   |  WriteXY(chr(Fc[WindowType,4]),LowerRightX, i,color); 
  166.   154 : + 1    |  END; 
  167.   155 : + 1    |  WriteXY(chr(Fc[WindowType,5]),UpperLeftX, LowerRightY, color); 
  168.   156 : + 1    |  FOR i:=UpperLeftX+1 TO LowerRightX-1 DO WriteXY(chr(Fc[WindowType,6]),i, 
  169.   156 : + 1    | LowerrightY,color); 
  170.   157 : + 1    |  WriteXY(chr(Fc[WindowType,7]),i+1,LowerRightY,color); 
  171.   158 : + 0   END  { Frame }; 
  172.   159 : + 0  
  173.   160 : + 0   PROCEDURE initialize; 
  174.   161 : + 0  
  175.   162 : + 0   { Set up memory and the stack } 
  176.   163 : + 0  
  177.   164 : + 0   VAR i:integer; 
  178.   165 : + 0  
  179.   166 : + 1   BEGIN 
  180.   167 : + 1    |  Stack_top:=0; 
  181.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 4
  182.  Line :  B    Statement
  183.  
  184.   168 : + 1    |  move(real_screen,screen,4000); 
  185.   169 : + 1    |  WITH imig[1] DO FOR i:=1 TO 4000 DO screen[i]:=$00; 
  186.   170 : + 1    |  FOR i:=2 TO 9 DO move(Imig[i-1].screen,imig[i].screen,4000); 
  187.   171 : + 1    |  move(imig[1].screen,screen,4000); 
  188.   172 : + 1    |  move(imig[1].screen,original,4000) 
  189.   173 : + 0   END; 
  190.   174 : + 0  
  191.   175 : + 0   PROCEDURE Add_window(UpperLeftX,UpperLeftY,LowerRightX,LowerRightY,Foregroun 
  192.   175 : + 0  d, 
  193.   176 : + 0   BackGround, WindowType: Integer); 
  194.   177 : + 0  
  195.   178 : + 0   { This procedure does all the laborous work for you.. The variables make it 
  196.   179 : + 0   Fairly easy to understand. } 
  197.   180 : + 0  
  198.   181 : + 0   VAR i,j,k,Color: Integer; 
  199.   182 : + 0  
  200.   183 : + 1   BEGIN 
  201.   184 : + 1    |  Imig[Stack_top].w1:=whereX; 
  202.   185 : + 1    |  Imig[Stack_top].w2:=WhereY; 
  203.   186 : + 1    |  UpperLeftX:=UpperLeftX+1; 
  204.   187 : + 1    |  LowerRightX:=LowerRightX-1; 
  205.   188 : + 1    |  LowerRightY:=LowerRightY-2; 
  206.   189 : + 1    |  f1:=WindowType;color:=0; 
  207.   190 : + 1    |  Scrn_off; 
  208.   191 : + 1    |  move(real_screen,screen,4000); 
  209.   192 : + 1    |  Scrn_on; 
  210.   193 : + 1    | 
  211.   194 : + 1    |  { Set color attribute for direct writeng to memory } 
  212.   195 : + 1    |  IF background < 17 THEN Color:=foreground+(background*16); 
  213.   196 : + 1    | 
  214.   197 : + 1    |  { Check for invalid window frame types } 
  215.   198 : + 1    |  IF (WindowType > 5) OR (WindowType < 0) THEN 
  216.   199 : + 2    |  BEGIN 
  217.   200 : + 2    |   |  Clrscr; 
  218.   201 : + 2    |   |  Writeln('Invalid Frame Type!') 
  219.   202 : + 1    |  END 
  220.   203 : + 1    |  ELSE 
  221.   204 : + 1    | 
  222.   205 : + 1    |  { If the window is valid then Procede } 
  223.   206 : + 2    |  BEGIN 
  224.   207 : + 2    |   | 
  225.   208 : + 2    |   |  { Fill color Attribute of window directly into memory } 
  226.   209 : + 2    |   |  k:=1; 
  227.   210 : + 2    |   |  FOR j:=UpperLeftY TO LowerRightY DO 
  228.   211 : + 2    |   |  FOR i:=UpperLeftX TO LowerRightX DO 
  229.   212 : + 3    |   |  BEGIN 
  230.   213 : + 3    |   |   |  k:=(j*160)+(i*2); 
  231.   214 : + 3    |   |   |  Screen[k]:=Color; 
  232.   215 : + 3    |   |   |  Screen[k-1]:=$20 
  233.   216 : + 2    |   |  END; 
  234.   217 : + 2    |   | 
  235.   218 : + 2    |   |  { Frame Window } 
  236.   219 : + 3    |   |  CASE Windowtype OF 
  237.   220 : + 3    |   |   |  1:Frame(WindowType,UpperLeftX-1,UpperLeftY-1, 
  238.   221 : + 3    |   |   |  LowerRightX+1,LowerRightY+1, 
  239.   222 : + 3    |   |   |  color); 
  240.   223 : + 3    |   |   |  2:Frame(WindowType,UpperLeftX-1,UpperLeftY-1, 
  241.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 5
  242.  Line :  B    Statement
  243.  
  244.   224 : + 3    |   |   |  LowerRightX+1,LowerRightY+1, 
  245.   225 : + 3    |   |   |  color); 
  246.   226 : + 3    |   |   |  3:Frame(WindowType,UpperLeftX-1,UpperLeftY-1, 
  247.   227 : + 3    |   |   |  LowerRightX+1,LowerRightY+1, 
  248.   228 : + 3    |   |   |  color); 
  249.   229 : + 3    |   |   |  4:Frame(WindowType,UpperLeftX-1,UpperLeftY-1, 
  250.   230 : + 3    |   |   |  LowerRightX+1,LowerRightY+1, 
  251.   231 : + 3    |   |   |  color); 
  252.   232 : + 2    |   |  END { Case } 
  253.   233 : + 1    |  END; 
  254.   234 : + 1    | 
  255.   235 : + 1    |  { Activate newly formed window } 
  256.   236 : + 1    |  Window(1,1,80,25); 
  257.   237 : + 1    |  Window(UpperLeftX,UpperLeftY+1,LowerRightX,LowerRightY+1); 
  258.   238 : + 1    |  push(UpperLeftx,UpperLeftY+1,LowerRightX,LowerRightY+1,Foreground, Backg 
  259.   238 : + 1    | round); 
  260.   239 : + 1    |  Scrn_off; 
  261.   240 : + 1    |  Move(screen,real_screen,4000);gotoxy(1,1); 
  262.   241 : + 1    |  Scrn_on; 
  263.   242 : + 1    |  Textcolor(Foreground);TextBackground(backGround);ClrScr; 
  264.   243 : + 0   END; 
  265.   244 : + 0  
  266.   245 : + 0   PROCEDURE Color_window(Foreground, Background: integer); 
  267.   246 : + 0  
  268.   247 : + 0   { This procedure allows you to change the foreground and background color 
  269.   248 : + 0   of the active window. } 
  270.   249 : + 0  
  271.   250 : + 0   VAR i,j,Color: Integer; 
  272.   251 : + 0  
  273.   252 : + 1   BEGIN 
  274.   253 : + 1    | 
  275.   254 : + 1    |  { Set Attribute value } 
  276.   255 : + 1    |  IF background < 8 THEN Color:=foreground+(background*16); 
  277.   256 : + 1    | 
  278.   257 : + 1    |  { Write new attribute direclty to screen memory } 
  279.   258 : + 1    |  FOR j:=(Imig[Stack_top].y1-2) TO Imig[Stack_top].y2 DO 
  280.   259 : + 1    |  FOR i:=(Imig[Stack_top].x1-1) TO (Imig[Stack_top].x2+1) DO 
  281.   260 : + 2    |  BEGIN 
  282.   261 : + 2    |   |  Real_Screen[(j*160)+(i*2)]:=Color 
  283.   262 : + 1    |  END 
  284.   263 : + 0   END; 
  285.   264 : + 0  
  286.   265 : + 0   PROCEDURE Remove(Num_to_Remove: Integer); 
  287.   266 : + 0  
  288.   267 : + 0   { This Procedure removes 1 or a specified number of windows from the 
  289.   268 : + 0   screen and reactivates the underlying window } 
  290.   269 : + 0  
  291.   270 : + 0   VAR i: integer; 
  292.   271 : + 1   BEGIN 
  293.   272 : + 1    |  IF (Num_to_Remove > 0) AND (Num_to_Remove < MaxScreens) THEN 
  294.   273 : + 1    |  FOR i:=1 TO Num_to_remove DO Pop 
  295.   274 : + 1    |  ELSE 
  296.   275 : + 1    |  Pop; 
  297.   276 : + 1    |  Window(1,1,80,25); 
  298.   277 : + 1    |  Window(Imig[Stack_top].x1+1,Imig[Stack_top].y1,Imig[Stack_top].x2,Imig[S 
  299.   277 : + 1    | tack_top].y2); 
  300.   278 : + 1    |  gotoxy(1,1); 
  301.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 6
  302.  Line :  B    Statement
  303.  
  304.   279 : + 1    |  TextBackground(Imig[Stack_top].b1);TextColor(Imig[Stack_top].c1); 
  305.   280 : + 1    |  GotoXY((Imig[Stack_top].w1-1),Imig[Stack_top].w2) 
  306.   281 : + 0   END; 
  307.   282 : + 0  
  308.   283 : + 0   PROCEDURE Window_Title(Name: Maxstr; color:integer); 
  309.   284 : + 0  
  310.   285 : + 0   VAR i, k, l, m: integer; 
  311.   286 : + 0  
  312.   287 : + 1   BEGIN 
  313.   288 : + 1    |  IF Length(name)>0 THEN 
  314.   289 : + 2    |  BEGIN 
  315.   290 : + 2    |   |  l:=1; 
  316.   291 : + 2    |   |  color:=color+(Imig[Stack_top].b1*16); 
  317.   292 : + 2    |   |  IF f1 < 4 THEN Real_Screen[(((Imig[Stack_top].Y1-2)*160)+(Imig[Stack 
  318.   292 : + 2    |   | _top].X1*2))+l]:=$5b; 
  319.   293 : + 2    |   |  FOR i:=1 TO length(Name) DO 
  320.   294 : + 3    |   |  BEGIN 
  321.   295 : + 3    |   |   |  k:=(((Imig[Stack_top].Y1-2)*160)+(Imig[Stack_top].X1*2))+l+1; 
  322.   296 : + 3    |   |   |  Real_Screen[k+1]:=ord(copy(Name,i,1)); 
  323.   297 : + 3    |   |   |  Real_Screen[k+2]:=color; 
  324.   298 : + 3    |   |   |  l:=l+2 
  325.   299 : + 2    |   |  END; 
  326.   300 : + 2    |   |  IF f1 < 4 THEN Real_Screen[k+3]:=$5d 
  327.   301 : + 1    |  END 
  328.   302 : + 0   END; 
  329.   303 : + 0  
  330.   304 : + 0   { Thats all.. } 
  331.   305 : + 0  
  332.   306 : + 0  
  333.   307 : + 0  
  334.   308 : + 0   {$I DemoDefs.Inc} 
  335.   309 : + 0   PROCEDURE Select_Window(Win_Num: Integer); 
  336.   310 : + 0   CONST Windows: ARRAY[1..9,1..8] OF integer =((5,5,40,15,12,0,2,0), 
  337.   311 : + 0   (43,5,73,15,10,0,3,12), 
  338.   312 : + 0   (5,16,73,23,9,0,1,0), 
  339.   313 : + 0   (0,0,0,0,0,0,0,0), 
  340.   314 : + 0   (0,0,0,0,0,0,0,0), 
  341.   315 : + 0   (0,0,0,0,0,0,0,0), 
  342.   316 : + 0   (0,0,0,0,0,0,0,0), 
  343.   317 : + 0   (0,0,0,0,0,0,0,0), 
  344.   318 : + 0   (0,0,0,0,0,0,0,0)); 
  345.   319 : + 0  
  346.   320 : + 0   Title:ARRAY[1..9] OF STRING[80] = ('', 
  347.   321 : + 0   'TEST TITLE', 
  348.   322 : + 0   '', 
  349.   323 : + 0   '', 
  350.   324 : + 0   '', 
  351.   325 : + 0   '', 
  352.   326 : + 0   '', 
  353.   327 : + 0   '', 
  354.   328 : + 0   ''); 
  355.   329 : + 0  
  356.   330 : + 1   BEGIN 
  357.   331 : + 1    |  IF (windows[win_num,3] > 0) AND (Win_num > Stack_top) THEN 
  358.   332 : + 2    |  BEGIN 
  359.   333 : + 2    |   |  Add_Window(Windows[Win_Num,1], 
  360.   334 : + 2    |   |  Windows[Win_Num,2], 
  361.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 7
  362.  Line :  B    Statement
  363.  
  364.   335 : + 2    |   |  Windows[Win_Num,3], 
  365.   336 : + 2    |   |  Windows[Win_Num,4], 
  366.   337 : + 2    |   |  Windows[Win_Num,5], 
  367.   338 : + 2    |   |  Windows[Win_Num,6], 
  368.   339 : + 2    |   |  Windows[Win_Num,7]); 
  369.   340 : + 2    |   |  IF Title[win_num] <> '' THEN 
  370.   341 : + 2    |   |  Window_Title(Title[Win_num],Windows[Win_Num,8]) 
  371.   342 : + 1    |  END 
  372.   343 : + 1    |  ELSE 
  373.   344 : + 1    |  IF windows[Win_num,4] > 0 THEN 
  374.   345 : + 2    |  BEGIN 
  375.   346 : + 2    |   |  Imig[Last_window_num].w1:=wherex; 
  376.   347 : + 2    |   |  Imig[Last_window_num].w2:=wherey; 
  377.   348 : + 2    |   |  Window(1,1,80,25); 
  378.   349 : + 2    |   |  GotoXY(1,1); 
  379.   350 : + 2    |   |  Window(Imig[Win_num].x1,Imig[Win_num].y1, 
  380.   351 : + 2    |   |  Imig[win_num].x2,Imig[win_num].y2); 
  381.   352 : + 2    |   |  Textcolor(Imig[win_num].c1+(Imig[win_num].b1*16)); 
  382.   353 : + 2    |   |  GotoXY(1,1); 
  383.   354 : + 2    |   |  GotoXY(Imig[win_num].w1,Imig[win_num].w2); 
  384.   355 : + 2    |   |  Last_Window_Num:=Win_Num 
  385.   356 : + 1    |  END 
  386.   357 : + 0   END; 
  387.   358 : + 0   {$I Growwin.Inc} 
  388.   359 : + 0   PROCEDURE Write_Screen(long_string:maxstr; xcoord,ycoord,color: integer); 
  389.   360 : + 0  
  390.   361 : + 0   VAR str_len, real_pos, scr_pos: integer; 
  391.   362 : + 0  
  392.   363 : + 1   BEGIN 
  393.   364 : + 1    |  str_len:=length(long_string); 
  394.   365 : + 1    |  Scr_pos:=0; 
  395.   366 : + 1    |  FOR real_pos:=1 TO str_len DO 
  396.   367 : + 1    |  IF scr_pos < 4001 THEN 
  397.   368 : + 2    |  BEGIN 
  398.   369 : + 2    |   |  scr_pos:=((xcoord*2)-1)+(ycoord*160); 
  399.   370 : + 2    |   |  Page_1[scr_pos]:=ord(copy(long_string,real_pos,1)); 
  400.   371 : + 2    |   |  Page_1[scr_pos+1]:=Color; 
  401.   372 : + 2    |   |  xcoord:=xcoord+1; 
  402.   373 : + 1    |  END 
  403.   374 : + 0   END; 
  404.   375 : + 0  
  405.   376 : + 0   PROCEDURE Grow_Frame(WindowType, UpperLeftX, UpperLeftY, LowerRightX, LowerR 
  406.   376 : + 0  ightY, color: Integer); 
  407.   377 : + 0   VAR i: integer; 
  408.   378 : + 1   BEGIN 
  409.   379 : + 1    |  Write_Screen(chr(Fc[WindowType,1]),UpperLeftX, UpperLeftY,Color); 
  410.   380 : + 1    |  FOR i:=UpperLeftX+1 TO LowerRightX-1 DO Write_Screen(chr(Fc[WindowType,2 
  411.   380 : + 1    | ]),i,UpperleftY,color); 
  412.   381 : + 1    |  Write_Screen(chr(Fc[WindowType,3]),i+1,UpperleftY,color); 
  413.   382 : + 1    |  FOR i:=UpperLeftY+1 TO LowerRightY-1 DO 
  414.   383 : + 2    |  BEGIN 
  415.   384 : + 2    |   |  Write_Screen(chr(Fc[WindowType,4]),UpperLeftX , i,color); 
  416.   385 : + 2    |   |  Write_Screen(chr(Fc[WindowType,4]),LowerRightX, i,color); 
  417.   386 : + 1    |  END; 
  418.   387 : + 1    |  Write_Screen(chr(Fc[WindowType,5]),UpperLeftX, LowerRightY, color); 
  419.   388 : + 1    |  FOR i:=UpperLeftX+1 TO LowerRightX-1 DO Write_Screen(chr(Fc[WindowType,6 
  420.   388 : + 1    | ]),i,LowerrightY,color); 
  421.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 8
  422.  Line :  B    Statement
  423.  
  424.   389 : + 1    |  Write_Screen(chr(Fc[WindowType,7]),i+1,LowerRightY,color) 
  425.   390 : + 0   END ; 
  426.   391 : + 0  
  427.   392 : + 0   PROCEDURE Grow_Window(x1,y1,x2,y2,c1,c2,wt:integer); 
  428.   393 : + 0  
  429.   394 : + 0  
  430.   395 : + 0   VAR i,j,p1,p2,p3,p4,sl,knt:integer; 
  431.   396 : + 0  
  432.   397 : + 1   BEGIN 
  433.   398 : + 1    |  p1:=x1+trunc((x2-x1)/2); 
  434.   399 : + 1    |  p2:=y1+trunc((y2-(y1))/2); 
  435.   400 : + 1    |  p3:=p1; 
  436.   401 : + 1    |  p4:=p2; 
  437.   402 : + 1    |  Scrn_off; 
  438.   403 : + 1    |  Move(real_Screen,page_1,4000); 
  439.   404 : + 1    |  Scrn_on; 
  440.   405 : + 1    |  Set_page($01); 
  441.   406 : + 1    |  IF p1>p2 THEN knt:=trunc((x2-x1)/2) 
  442.   407 : + 1    |  ELSE knt:=trunc((y2-y1)/2); 
  443.   408 : + 1    |  y1:=y1-1; 
  444.   409 : + 1    |  y2:=y2-1; 
  445.   410 : + 1    |  x1:=x1+1; 
  446.   411 : + 1    |  x2:=x2-1; 
  447.   412 : + 1    |  FOR sl:=1 TO round(Knt/3) DO 
  448.   413 : + 2    |  BEGIN 
  449.   414 : + 2    |   |  IF p1>(x1-2) THEN 
  450.   415 : + 2    |   |  p1:=p1-3 
  451.   416 : + 2    |   |  ELSE 
  452.   417 : + 2    |   |  IF p1>(x1-1) THEN 
  453.   418 : + 2    |   |  p1:=p1-2 
  454.   419 : + 2    |   |  ELSE 
  455.   420 : + 2    |   |  IF p1>x1 THEN 
  456.   421 : + 2    |   |  p1:=p1-1; 
  457.   422 : + 2    |   |  IF p3<(x2+2) THEN 
  458.   423 : + 2    |   |  p3:=p3+3 
  459.   424 : + 2    |   |  ELSE 
  460.   425 : + 2    |   |  IF p3<(x2+1) THEN 
  461.   426 : + 2    |   |  p3:=p3+2 
  462.   427 : + 2    |   |  ELSE 
  463.   428 : + 2    |   |  IF p3<x2 THEN 
  464.   429 : + 2    |   |  p3:=p3+1; 
  465.   430 : + 2    |   |  IF p2>(y1+2) THEN 
  466.   431 : + 2    |   |  p2:=p2-3 
  467.   432 : + 2    |   |  ELSE 
  468.   433 : + 2    |   |  IF p2>(y1+1) THEN 
  469.   434 : + 2    |   |  p2:=p2-2 
  470.   435 : + 2    |   |  ELSE 
  471.   436 : + 2    |   |  IF p2>y1 THEN 
  472.   437 : + 2    |   |  p2:=p2-1; 
  473.   438 : + 2    |   |  IF p4<(y2-2) THEN 
  474.   439 : + 2    |   |  p4:=p4+3 
  475.   440 : + 2    |   |  ELSE 
  476.   441 : + 2    |   |  IF p4<(y2-1) THEN 
  477.   442 : + 2    |   |  p4:=p4+2 
  478.   443 : + 2    |   |  ELSE 
  479.   444 : + 2    |   |  IF p4<y2 THEN 
  480.   445 : + 2    |   |  p4:=p4+1; 
  481.  09 Aug 1985 at 08 : 30  Formated Listing for : DEFDEMO.PAS           Page 9
  482.  Line :  B    Statement
  483.  
  484.   446 : + 2    |   |  Normvideo; 
  485.   447 : + 2    |   |  window(p1,p2,p3,p4); 
  486.   448 : + 2    |   |  clrscr; 
  487.   449 : + 2    |   |  Grow_frame(wt,p1,p2,p3,p4,(c1+(c2*16))); 
  488.   450 : + 1    |  END; 
  489.   451 : + 1    |  p2:=p2+1; 
  490.   452 : + 1    |  p4:=p4+1; 
  491.   453 : + 1    |  Add_Window(p1,p2,p3,p4,c1,c2,wt); 
  492.   454 : + 1    |  Set_page($00) 
  493.   455 : + 0   END; 
  494.   456 :   0  
  495.   457 :   0   VAR ch:char; 
  496.   458 :   0   i:integer; 
  497.   459 :   0  
  498.   460 :   1   BEGIN 
  499.   461 :   1    |  Initialize; 
  500.   462 :   1    |  clrscr; 
  501.   463 :   1    |  i:=0; 
  502.   464 :   1    |  Select_window(1); 
  503.   465 :   1    |  Select_Window(2); 
  504.   466 :   1    |  Select_Window(3); 
  505.   467 :   2    |  REPEAT 
  506.   468 :   2    |   |  Select_Window(1); 
  507.   469 :   2    |   |  Write('Window number 1 '); 
  508.   470 :   2    |   |  Select_window(2); 
  509.   471 :   2    |   |  write('Window number 2 '); 
  510.   472 :   2    |   |  Select_window(3); 
  511.   473 :   2    |   |  write('Window number 3 '); 
  512.   474 :   2    |   |  i:=i+1; 
  513.   475 :   2    |   |  IF i=40 THEN 
  514.   476 :   3    |   |  BEGIN 
  515.   477 :   3    |   |   |  Grow_window(22,7,58,22,14,0,2); 
  516.   478 :   3    |   |   |  textcolor(2); 
  517.   479 :   3    |   |   |  FOR i:=1 TO 100 DO 
  518.   480 :   4    |   |   |  BEGIN 
  519.   481 :   4    |   |   |   |  write(' Growing Window '); 
  520.   482 :   4    |   |   |   |  delay(10) 
  521.   483 :   3    |   |   |  END; 
  522.   484 :   3    |   |   |  delay(1000); 
  523.   485 :   3    |   |   |  remove(1); 
  524.   486 :   3    |   |   |  i:=0 
  525.   487 :   2    |   |  END 
  526.   488 :   1    |  UNTIL keypressed 
  527.   489 :   0   END. 
  528.  09 Aug 1985 at 08 : 30  Cross Reference for :  DEFDEMO.PAS           Page 1
  529.  
  530.      A                  46   51
  531.      ACTIVE             54   56
  532.      ADD_WINDOW        175  333  453
  533.      AX                 34   39
  534.      B                 292
  535.      B0                 46   51
  536.      B1                 14   81  279  291  352
  537.      B800                3
  538.      BA                 46   51
  539.      BACKGROUND         59   81  176  195  195  238  242  245  255  255
  540.      BP                 34
  541.      BX                 34   40
  542.      BYTE               15   20   21   22   24   29   34
  543.      C1                 14   80  279  352  392  449  453
  544.      C2                392  449  453
  545.      CH                457
  546.      CHAR              457
  547.      CHR               147  148  149  152  153  155  156  157  379  380  381
  548.                        381  384  385  387  388  389
  549.      CLRSCR            200  242  448  462
  550.      COLOR             115  136  142  147  148  149  152  153  155  156  157
  551.                        157  181  189  195  214  222  225  228  231  250  255
  552.                        255  261  283  291  291  297  359  371  376  379  380
  553.                        380  381  384  385  387  388  389
  554.      COLOR_WINDOW      245
  555.      COORDS             25
  556.      COPY              135  296  370
  557.      CX                 34
  558.      D                 300
  559.      D8                 46   51
  560.      DATA_ADDR           5   21
  561.      DELAY             482  484
  562.      DI                 34
  563.      DS                 34
  564.      DX                 34
  565.      EE                 46   51
  566.      ES                 34
  567.      F1                 19  189  292  300
  568.      FC                  6  147  148  149  152  153  155  156  157  379  380
  569.                        380  381  384  385  387  388  389
  570.      FLAGS              34
  571.      FOREGROUND         59   80  175  195  238  242  245  255
  572.      FRAME             142  220  223  226  229
  573.      GOTOXY            240  278  280  349  353  354
  574.      GROW_FRAME        376  449
  575.      GROW_WINDOW       392  477
  576.      I                 145  148  148  149  150  152  153  156  156  157  164
  577.                        164  169  169  170  170  170  181  211  213  250  259
  578.                        259  261  270  273  285  293  296  377  380  380  381
  579.                        381  382  384  385  388  388  389  395  458  463  474
  580.                        474  474  475  479  486
  581.      IMIG               23   76   77   78   79   80   81   86  110  169  170
  582.                        170  170  171  172  184  185  258  258  259  259  277
  583.                        277  277  277  277  279  279  280  280  291  292  292
  584.                        292  295  295  346  347  350  350  351  351  352  352
  585.                        352  354  354
  586.      INITIALIZE        160  461
  587.      INTEGER             6   14   19   25   54   59  115  115  121  142  145
  588.  09 Aug 1985 at 08 : 30  Cross Reference for :  DEFDEMO.PAS           Page 2
  589.  
  590.                        145  164  176  181  245  250  265  270  283  285  309
  591.                        309  310  359  361  376  377  392  395  458
  592.      INTR               41
  593.      J                 181  210  213  250  258  261  395
  594.      K                 181  209  213  214  215  285  295  296  297  300
  595.      KEYPRESSED        488
  596.      KNT               395  406  407  412
  597.      L                 285  290  292  295  298  298
  598.      LAST_WINDOW_NUM    18  346  347  355
  599.      LENGTH            125  288  293  364
  600.      LINE_POS           19
  601.      LONG_STRING       115  125  135  359  364  370
  602.      LOWERRIGHTX       142  148  153  156  175  187  187  211  221  224  227
  603.                        227  230  237  238  376  380  385  388
  604.      LOWERRIGHTY       142  150  155  156  157  175  188  188  210  221  224
  605.                        224  227  230  237  238  376  382  387  388  389
  606.      LRX                59   78
  607.      LRY                59   79
  608.      M                 285
  609.      MAXSCREENS          2   23   25   73  272
  610.      MAXSTR             12  115  283  359
  611.      MOVE               69   86  104  110  168  170  171  172  191  240  403
  612.      NAME              283  288  293  296
  613.      NORMVIDEO         101  446
  614.      NUM_TO_REMOVE     265  272  272  273
  615.      ORD               135  296  370
  616.      ORIGINAL           24   69  104  172
  617.      P1                395  398  400  406  414  415  415  417  418  418  420
  618.                        420  421  421  447  449  453
  619.      P2                395  399  401  406  430  431  431  433  434  434  436
  620.                        436  437  437  447  449  451  451  453
  621.      P3                395  400  422  423  423  425  426  426  428  429  429
  622.                        429  447  449  453
  623.      P4                395  401  438  439  439  441  442  442  444  445  445
  624.                        445  447  449  452  452  453
  625.      PAGE               29   39
  626.      PAGE_1             22  370  371  403
  627.      POP                90  273  275
  628.      PUSH               59  238
  629.      REAL_POS          121  131  135  361  366  370
  630.      REAL_SCREEN        21   69   86  104  110  168  191  240  261  292  296
  631.                        296  297  300  403
  632.      REC                36   39   40   41
  633.      REMOVE            265  485
  634.      RESULT             32   36
  635.      ROUND             412
  636.      SCREEN             15   20   86  110  135  136  168  169  170  170  171
  637.                        171  171  172  191  214  215  240
  638.      SCREEN_SEG          3   21   22
  639.      SCRN_OFF           44   68   85  103  109  190  239  402
  640.      SCRN_ON            49   70   87  105  111  192  241  404
  641.      SCR_POS           121  126  132  134  135  136  361  365  367  369  370
  642.                        370  371
  643.      SELECT_WINDOW     309  464  465  466  468  470  472
  644.      SET_PAGE           29  405  454
  645.      SI                 34
  646.      SL                395  412
  647.      STACK_TOP          18   56   66   73   73   75   75   76   77   78   79
  648.  09 Aug 1985 at 08 : 30  Cross Reference for :  DEFDEMO.PAS           Page 3
  649.  
  650.                         79   80   81   86   99  110  112  112  167  184  185
  651.                        185  258  258  259  259  277  277  277  277  279  279
  652.                        279  280  280  291  292  292  295  295  331
  653.      STR_LEN           121  125  131  361  364  366
  654.      TEXTBACKGROUND    242  279
  655.      TEXTCOLOR         242  279  352  478
  656.      TITLE             320  340  341
  657.      TRUNC             398  399  406  407
  658.      ULX                59   76
  659.      ULY                59   77
  660.      UPPERLEFTX        142  147  148  152  155  156  175  186  186  211  220
  661.                        220  223  226  229  237  238  376  379  380  384  387
  662.                        387  388
  663.      UPPERLEFTY        142  147  148  149  150  175  210  220  223  226  229
  664.                        229  237  238  376  379  380  381  382
  665.      W1                 14  184  280  346  354
  666.      W2                 14  185  280  347  354
  667.      WHEREX            184  346
  668.      WHEREY            185  347
  669.      WINDOW            102  236  237  276  277  348  350  447
  670.      WINDOWS           310  331  333  334  335  336  337  338  339  341  344
  671.      WINDOWTYPE        142  147  148  149  152  153  155  156  157  176  189
  672.                        189  198  198  219  220  223  226  229  376  379  380
  673.                        380  381  384  385  387  388  389
  674.      WINDOW_REC         13   23
  675.      WINDOW_TITLE      283  341
  676.      WIN_NUM           309  331  331  333  334  335  336  337  338  339  340
  677.                        340  341  341  344  350  350  351  351  352  352  354
  678.                        354  354  355
  679.      WRITE             469  471  473  481
  680.      WRITELN           201
  681.      WRITEXY           115  147  148  149  152  153  155  156  157
  682.      WRITE_SCREEN      359  379  380  381  384  385  387  388  389
  683.      WT                392  449  453
  684.      X1                 14   76  259  277  292  295  350  392  398  398  406
  685.                        406  410  410  414  417  420
  686.      X2                 14   78  259  277  351  392  398  406  411  411  422
  687.                        422  425  428
  688.      XCOORD            115  134  137  137  359  369  372  372
  689.      Y1                 14   77  258  277  292  295  350  392  399  399  407
  690.                        407  408  408  430  433  436
  691.      Y2                 14   79  258  277  351  392  399  407  409  409  438
  692.                        438  441  444
  693.      YCOORD            115  134  359  369
  694.  09 Aug 1985 at 08 : 30  Functions and Procedures for :  DEFDEMO.PAS                                                Page 1
  695.  
  696.  
  697.       Line   Function  Name    Passed Variables 
  698.  
  699.         54   Active            : integer
  700.  
  701.       Line   Procedure Name    Passed Variables 
  702.  
  703.        175   Add_window        (UpperLeftX,UpperLeftY,LowerRightX,LowerRightY,Foreground,
  704.        245   Color_window      (Foreground, Background: integer)
  705.        142   Frame             (WindowType, UpperLeftX, UpperLeftY, LowerRightX, LowerRightY, color: Integer)
  706.        376   Grow_Frame        (WindowType, UpperLeftX, UpperLeftY, LowerRightX, LowerRightY, color: Integer)
  707.        392   Grow_Window       (x1,y1,x2,y2,c1,c2,wt:integer)
  708.        160   Initialize        
  709.         90   Pop               
  710.         59   Push              (Ulx, Uly, Lrx, Lry, Foreground, Background: integer)
  711.        265   Remove            (Num_to_Remove: Integer)
  712.         44   Scrn_off          
  713.         49   Scrn_on           
  714.        309   Select_Window     (Win_Num: Integer)
  715.         29   Set_page          (page: byte)
  716.        283   Window_Title      (Name: Maxstr; color:integer)
  717.        359   Write_Screen      (long_string:maxstr; xcoord,ycoord,color: integer)
  718.        115   Writexy           (long_string:maxstr; xcoord,ycoord:integer; var color: integer)
  719.  
  720.  
  721.      Number Include Files      :     4
  722.      Total Number Functions    :     1
  723.      Total Number Procedures   :    16
  724.      Total Different Variables :   122
  725.      Total Variables Used      :  1288
  726.      Total Lines Processed     :   490
  727.